/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
//身份证格式验证
        function identityCodeValidate(idcardNumber){
            if(!/^\d{6}(18|19|20)?\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])\d{3}(\d|X)$/i.test(idcardNumber)) {
                layer.msg('身份证号格式不正确!');
                return false;
            }
            return true;
        }
        //生日格式验证
        function birthdayValidate(birthday){
            if(!/^(18|19|20)\d{2}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/.test(birthday)) {
                layer.msg('生日格式不正确!');
                return false;
            }
            return true;
        }
        //手机号或者电话号码格式验证
        function mobileValidate(mobile){
            if(!/^(1\d{10})|(0\d{2,3}-?\d{7,8})$/.test(mobile)||mobile===''||mobile===null) {
                layer.msg('手机号或电话号码格式不正确!');
                return false;
            }
            return true;
        }
        
         function trimStr(str){return str.replace(/(^\s*)|(\s*$)/g,"");}

